package com.dibang.app.operation.view.impl;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dibang.app.R;
import com.dibang.app.bean.SearchAdrItem;
import com.dibang.app.mvp.abs.AbsView;
import com.dibang.app.operation.control.abs.ByBusLocationControl;
import com.dibang.app.operation.model.abs.ByBusLocationModel;
import com.dibang.app.operation.presenter.abs.ByBusLocationPresenter;
import com.dibang.app.operation.view.abs.ByBusLocationView;
import com.dibang.app.view.ViewHelper;

import java.util.List;

/**
 * Created by wxl on 2019/8/5.
 */

public class ByBusLocationViewImpl extends AbsView<ByBusLocationControl,ByBusLocationView,ByBusLocationPresenter,ByBusLocationModel> implements ByBusLocationView {


    @Override
    public void notifyHistoryRecordSearch(@Nullable RecyclerView rsView, @NonNull List<SearchAdrItem> records) {
        ViewHelper.setRecyclerViewLinearLayoutManager(rsView);
        rsView.setAdapter(new BaseQuickAdapter<SearchAdrItem,BaseViewHolder>(R.layout.item_search_record_layout,records) {
            @Override
            protected void convert(BaseViewHolder helper, SearchAdrItem item) {
                helper.setText(R.id.search_record_item_title_view,item.getTitle());
                helper.setText(R.id.search_record_item_subtitle_view,item.getSubTitle());
            }
        });
    }
}
